package com.sam4cloud.oauth2.project.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.sam4cloud.common.core.enums.DelFlagEnum;
import com.sam4cloud.common.core.enums.StatusEnum;
import com.sam4cloud.common.core.model.supers.Convert;
import com.sam4cloud.oauth2.project.enums.FreezeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * <p>
 * 认证账户表
 * </p>
 *
 * @author Sam
 * @since 2022-12-05
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("oauth_account")
@ApiModel(value = "OauthAccount对象", description = "认证账户表")
public class OauthAccount extends Convert {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("id")
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    @ApiModelProperty("账户名称")
    private String name;

    @ApiModelProperty("企业id")
    private String appId;

    @ApiModelProperty("企业密钥")
    private String appSecret;

    @ApiModelProperty("认证凭证")
    private String accessToken;

    @ApiModelProperty("过期时间")
    private Long expiresIn;

    @ApiModelProperty("授信域名(,号分割)")
    private String creditDomain;

    @ApiModelProperty("冻结状态 0-正常 1-冻结")
    private FreezeEnum isFreeze;

    @ApiModelProperty("状态 0-有效 1-无效")
    private StatusEnum status;

    @ApiModelProperty("删除标识 0-正常 1-删除")
    @TableLogic
    private DelFlagEnum delFlag;

    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;


}
